import request from '@/utils/request'

/**
 * 查询列表
 * @param data
 * @returns {*}
 */
export function getList(data) {
  return request({
    url: '/shopList',
    method: 'post',
    data,
    hideLoading: true
  })
}

/**
 * 上传图片
 * @param data
 * @returns {*}
 */
export function upload(data) {
  return request({
    url: '/upload/image',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}

/**
 * 添加商品
 * @param shopId
 * @returns {*}
 */
export function addProduct(data) {
  return request({
    url: '/shopAdd',
    method: 'post',
    data
  })
}

/**
 * 删除商品
 * @param shopId
 * @returns {*}
 */
export function delProduct(shopId) {
  return request({
    url: '/shopDel?shopId=' + shopId,
    method: 'get'
  })
}

/**
 * 获取商品
 * @param shopId
 * @returns {*}
 */
export function getProduct(shopId) {
  return request({
    url: '/getShop?shopId=' + shopId,
    method: 'get'
  })
}

